<template>
  <div>
    <el-dialog
  title="新增"
  :visible.sync="isExit2"
  width="30%"
  style="text-align:left;"
  :close-on-click-modal="false"
  >
  <el-form :label-position="labelPosition" label-width="80px" :model="initEdit">
  <el-form-item label="功能名称">
    <el-input v-model="initEdit.menuText"></el-input>
  </el-form-item>
  <el-form-item label="是否启用">
    <el-radio-group v-model="initEdit.menuIsmodify">
      <el-radio label="启用"></el-radio>
      <el-radio label="禁用"></el-radio>
    </el-radio-group>
  </el-form-item>
  <el-form-item label="功能类型">
    <el-input v-model="initEdit.menuType"></el-input>
  </el-form-item>
  <el-form-item label="创建时间">
    <el-input v-model="initEdit.menuCreatetime"></el-input>
  </el-form-item>
  <el-form-item label="备注">
    <el-input v-model="initEdit.menuNote"></el-input>
  </el-form-item>
</el-form>
  <span slot="footer" class="dialog-footer">
    <el-button @click="canleHandle()" size="small">取消</el-button>
    <el-button type="primary" @click="saveHandle()" size="small">确 定</el-button>
  </span>
</el-dialog>
  </div>
</template>
<script>
export default {
  data(){
    return {
      labelPosition: 'right',
      initEdit:{
        menuText:'',
        menuIsmodify:'启用',
        menuType:'',
        menuCreatetime:Date.now(),
        menuNote:''
      },
      isExit2:true
    }
  },
  props:{
    isExit1:Boolean
  },
  created(){
    this.isExit2 = this.isExit1
  },
  methods:{
    saveHandle(){
      this.$emit('event1',this.initEdit)
      this.$message({
          message: '内容添加成功 ！',
          type: 'success'
        });
      this.isExit2 = false
    },
    canleHandle(){
      this.$message('内容取消添加 ！');
      this.isExit2 = false
    }
  }
}
</script>
<style lang="css">

</style>